
const gulp = require('gulp');
const sass = require('gulp-sass');
const autoprefixer = require('gulp-autoprefixer');
const sourcemaps = require('gulp-sourcemaps');
const runSequence = require('run-sequence');

gulp.task('default', function ( callback ) {
	runSequence('clean-temp',['generate-css','browserify'], callback);
});

gulp.task('generate-css', function () {
	gulp.src('./app/assets/css/*.scss')
		.pipe(sourcemaps.init())
			.pipe(sass().on('error', sass.logError))
			.pipe(autoprefixer({
				browsers: ['last 2 versions','IE 8','IOS 7','> 5%']
			}))
		.pipe(sourcemaps.write())
		.pipe(gulp.dest('./.temp/assets/css'));
});